<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>广告配置管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- 确保适当的绘制和触屏缩放 -->
    <link rel="stylesheet" href="{$url_css}bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="{$url_css}admin.css" type="text/css">
    <link rel="stylesheet" href="{$url_css}viewer.min.css" type="text/css"/>
    <script type="text/javascript" src="{$url_js}jquery-1.12.0.min.js"></script>
    <script type="text/javascript" src="{$url_js}viewer-jquery.min.js"></script>
</head>
<body>

<div class="container" style="width:96%">
    <table class="table table-bordered table-striped" align="center">
        <tr>
            <td><a href="?do=edit" class="btn btn-primary">添加广告</a></td>
        </tr>
    </table>
    <table class="table table-bordered table-striped table-hover" align="center">
        <thead>
            <tr>
                <td colspan="9">广告列表</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>ID</td>
                <td>活动名称</td>
                <td>URL地址</td>
                <td>广告图</td>
                <td>广告开始时间</td>
                <td>广告结束时间</td>
                <td>创建时间</td>
                <td>操作</td>
            </tr>

            {if !empty($list)}
                {foreach $list as $k=> $v}
                    <tr>
                        <td align="center">{$v.Id}</td>
                        <td align="center">{$link[$v.Url]}</td>
                        <td align="center">{$v.Url}</td>
                        <td align="center">
                            <a class="img" target="_blank"><img src="{$v.ImgUrl}" width="100px" height="120px"/><a/>
                        </td>
                        <td align="center">{$v.StartTime}</td>
                        <td align="center">{$v.EndTime}</td>
                        <td align="center">{$v.CreateTime}</td>
                        <td align="center">
                            <a href="?do=delete&id={$v.Id}" class="btn btn-danger delete delete_btn">删除</a>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="?do=Edit&id={$v.Id}" class="btn btn-info">修改</a>
                        </td>
                    </tr>
                {/foreach}
            {/if}

        </tbody>
    </table>
	{if !empty($pagination)}
        <table class="table table-bordered table-striped" align="center">
            <tr>
                <td colspan="7" align="right">
                    <div class="page_info">
						{if $page_info['count']}
                            <div class="p_l">一共 {$page_info['count']} 条数据,共 {$page_info['page']} 页</div>
						{/if}
                    </div>
                    <div class="p_r">{$pagination}</div>
                </td>
            </tr>
        </table>
	{/if}
</div>

{literal}
<script>
    $('.img').viewer();
    //删除
    $(".delete_btn").click(function(){
        var url = self.location.pathname + $(this).attr("href");
        top.__confirm('确定要删除吗？','删除后不可恢复！', url, self);
        return false;
    });
</script>
{/literal}
</body>
<html>